package com.wuxin.ssm.service;


import com.wuxin.ssm.entity.Carshop;

import java.util.List;

/**
 * @program: untitled
 * @ClassName CarShopService
 * @description:
 * @author: 李尧坤
 * @create: 2024−12-17 20:36
 * @Version 1.0
 **/

public interface CarShopService {
    /**
     * 存入购物车
     * @param carshop
     * @return
     */
    public int save(Carshop carshop);



    List<Carshop> getAllCarShopByUserId(Integer uid);

    /**
     * 删除购物车中的商品
     * @param cid
     */
    public void deleteById(Integer cid);

    /**
     *  更新购物车中购买商品的数量
     * @param carshop
     */
    public void updateCarShop(Carshop carshop);

    /**
     *  查询购物车中是否存在该商品
     * @param carshop
     * @return
     */
    public Carshop findByUidAndPid(Carshop carshop);

    /**
     *  uid和pid 清理购物车
     * @param pid
     * @param uid
     */
    void deleteById2(Integer pid, Integer uid);



}
